Add needsToken(), mustBePosted() and isWriteMode()

This is mostly kitchen sink stuff that should be part of the
modules to block abuse.

Change-Id: I827844503147b36825a4b3615a4b47950af773ad
Merge "Add needsToken(), mustBePosted() and isWriteMode()"