Minor refactoring to build system

First step in removing duplication among common components. Preparing
to add global log framework.