Simplified build.

Hopefully this will make it easier to set the project up as a library.