WIP - starts rewrite of tests, marketplaces - apply

Still a WIP at present.