Set menu active state for custom posttype and category, given custom taxonomy term

When you create a custom menu item for the custom post type archive you have to include the entire url and not just /your-custom-post-type-name. If you use the entire url the wordpress url rewrite function will check it against all the other menu items as well as against all your pages and so on. What you end up with in the menu parent is something like current-menu-ancestor current-menu-parent current_page_parent current_page_ancestor.