Better build system, some cleanup