Code cleanups
Some future-proofing
Test cleanups
Update formatting code
Refactorings
Some more minor test fixes
Add set and rawset
Refactoring shifts
Update shift API
Refactor diff
Minor cleanup