This PR fixes the build and adds some tests.

I will recheck and replace __VERSION_NO__ with __DEPLOY_VERSION__ for new stuff and not change instances where __VERSION_NO__ is present for pre-existing code.