Massive changes to allow Woocommerce integration