Variation patch & sanitized product_type names

Two different issues addressed with this pull request:

1. SHA: e2c50cd529 sets the `$variation` variable to a `WP_Post` object when adding a variation via ajax on the "Edit Product page. At the moment, when the `variation-admin-html.php` template is loaded on the "Edit Product" screen, `$variation` is a `WP_Post` object. When the template is loaded by `woocommerce_add_variation()` to handle an ajax call, `$variation` is an array. The `variation-admin-html.php` template doesn't use `$variation` so it doesn't affect WC core, but it does pass it as a param on the `'woocommerce_product_after_variable_attributes'`
and `'woocommerce_variation_options'` hooks, so this commit makes the `$variation` consistent for functions using those.

1. SHA: 2eb8b26a & SHA: 9247e327 are related to #2496 and SHA: 80b4ef1, in short, `product_type` term names may have white space and other characters unsafe for use in an option field's value, a class name or hook, so this commit runs `product_type` term names that may potentially be troublesome through `sanitize_title()`.