Some configuration/build fixes

Basically makes it possible to disable everything except the core library.
Also fixes some other minor problems.