NEW optionally skip encoding
FIX environment setup

A few mistakes were present; fix them and introduce tests.
Merge pull request #92 from Motiejus/env_tests

Env tests