Updated the library and added some methods

Hi, 

First of all thanks for sharing this library. 

I used it for a personal project and thus had to add some methods so it suit my needs. 
I've also made few changes to make it work with last Ruby and Rails versions. 

Cheers.