maybe broken first commit to get the require working
added tests

also refactor to remove rails dependency