Added build script and refactored into a package.