Reduce repeated code in dump/load.
Add support for constant arithmetic.