Add LogEncoder

Addresses #88.

Also fixes a bug in ScalarEncoder. ScalarEncoders with `minVal == 0` or `maxVal == 0` (and consequently LogEncoders with `minVal == 1` or `maxVal == 1`) weren't handled properly - `0` was basically treated as `NaN`.