Merge pull request #12 from tianon/minor-tweaks

Add a few minor tweaks and reorganizations to improve caching and overall build