add Rakefile and move files into lib and test