Move auto_complete from plugin to lib to support Rails 4.0+