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
As a gem, none of this code is needed as the lib directory will be included in the load path.