Move activity_tracker from plugin to lib to support Rails 4.0+