Reduce rails dependency to >= 3.1.0
Only attempt script insertion if config.assets.debug = true

This should take care of #3