Refactor with build system. [WIP]

Don't merge yet!