API implementation merge to master

Massive props to @maxrice, who went above and beyond getting this API ready for merging into WooCommerce 2.1. Now it's up to us to make sure we test and determine wether or not it's any good. ;)

Detailed description and full changelog can be found in #4055.