Minor cleanup and added support for building it as a gem