encoder.js :: implement encodeBinary() and tests