Move bioenv function into base module

Due to bug in nose:

https://github.com/nose-devs/nose/issues/92

Also fix subtle bug in scale calculations that was discovered while doctesting. It appears that R's scale and sklearn's scale don't work the same way.

Still some minor cleanup to do, and need more unit tests to cover the scale bug.