removed rails dependencies, cleaned up a bit

@pedromartinez please look at this **really** close. I want to write some more tests, but I had to stop for today. Figured I'd go ahead and put it up to let you get a look.
Trailing whitespace detected.