Reorganize the build package, make it match upstream patterns

Based on #85 refactored code to meet upstream patterns. After this PR got merged please close #87.