Add generic methods for pickling

- Adds `PickleMacros`
- Fixes bugs related to static elision
- Adds several new pickling tests