Adjust how tokens work.
Fix bug with document maxWeight not being set correctly.