Make it work with Rails 4

Both Rails.application.routes.url_helpers and ApplicationHelper are not available on startup when using Rails 4, leading to a crash on startup with render_anywhere. This patch avoids that by moving those calls to the initialize, where they are available. 

I have not tested this with older versions of Rails.