added minitest rakefile
added minitest
added tests
refactored and moved code to tests