Parses AVM1 action bytes and generates JS function