Changed build system to include a library and minimized hakefiles of applications.