Rubygems rewrite

Hey I updated this gem for a friend and thought I should send you a pull request too.

Here's what I changed:
* Use a more modern gem structure
* Add documentation
* Add tests