Added database building to the build script along with some path handling improvements.