Modified build.

Not working with packages and modules in this branch, only be sure to
fix all the errors.