Hooks up rake test

Splits out class so testing won't create a task / can find the file with .rb extension
Renames test file so it's picked up by rake test
Moves Ruby logic to lib
Why was this renamed?