Moved code into activity_hint.rb, added tests.