Fix for Rack apps with a Rails constant, but no Rails, and a forward-compat fix for app preload detection