Add commerce_cart_add_to_cart_form() and commerce_cart_add_to_cart_form_submit(). Change commerce_cart_field_formatter_view() to just place an empty div container, then use its pageshow handler to inject the add to cart form. Remove _commerce_cart_field_formatter_view_container() and _commerce_cart_field_formatter_view_container_id().