Refactor some code
Add a basic Rakefile