Cleanup build env

This PR cleans up the build environment by grouping the objects/sources in modules.