Cleaned up Rakefile, updated service code and tests a bit.