fix marshaling; add go license and README
add tests and fix code