Work in a non-Rails environment

Some minor tweaks to make it usable in a test environment that doesn't include Rails