clean up build system
removed global state, added acid test