minor changes in wasm
reformat source code
improve code readability
add new typedefs