Restructure code files and add build script