Implement deduplication of arities in the Pickler
Use std::nullptr_t instead of our custom-defined type

* other places in the codebase already use it anyway.
Fix a segfault due to what seems a bug in GCC
Add a test for pickling, based on base/pickles.oz
Implement deduplication of builtins in the Pickler