Moved some 'require' statements to the correct position
Reorganized modules and initialization
Replaced monkey patching by extending ActiveRecord::Base
Moved the initialization to the Railtie initializer and updated the tests to initialize too.