reshuffled the files, added gem support, and made a few things more idiomatic