Most of this is just a matter of spacing and punctuation. However:
I resolved the disagreement between new flag names and internal names. I don't care what exactly they're called and can go the other way if you like, but the names really ought to be consistent as it was hard for me to track otherwise.
I fixed a few apparent typing errors.
The TODOs I added are ones where I need help from you (@adamits or @bonham79) to figure out what the types ought to be. I'll resolve those before submitting.
I made use of constants in a few places where they weren't being used after #186.
Most of this is just a matter of spacing and punctuation. However: