switches to using the passed environment, rather than Rails.env

Just noticed this while reading over the code.

Also - made the test task by the default task