Fix compilation of "not x" and some general cleanup.

The branch is misnamed, the contents is general cleanups and support for bool in the C99 platform. 

@emwap: Is there anything preventing us from relying on studbool.h for the C99 platform, which is already included in the platform includes? This is what 334c1defeacf20117ee8cb0ba4f9fae3eab9d591 enables.