Binary encoding for Javascript objects