tests + cleanup

The only non passing test is int64, all the other base type pass.
I also reworked load and dump to make them readable and debuggable.