Moved binary encoding logic to module js-binary