Massive restructuring

 * cleaned up shlib so that it can be sanely nested as a submodule
   within other projects.