Turn into a proper Gem

This was full of awful legacy stuff

cc @charliesome