Check if Rails::Railtie class is defined

Old versions of Rails don't support Railtie.
Merge pull request #8 from josh/master

Check if Rails::Railtie class is defined