Create message encoder / decoder using javascript