Separated into modules.
Added an executable for building.