Improve initialization of the Railtie

This should fix some loading order related issues within Rails environments.
Going to test this on bladerunner.

@jstorimer @disaacs for review.