Deduplicate features in the Pickler

* Move PickleNode to the header since we need it as an argument type.
Move the Pickler topLevelValue to an argument of pickle()
Reorder a few methods of Pickler
Implement deduplication of builtins in the Pickler