Updated Gemfile, Rakefile and improved unit tests