Type lock state constants as uint8_t instead of char
Fight back unnecessary #includes
Make use of MOAR C99 features

Namely related to for loops. Then there's some random, insignificant cleanup/reorganization.
Client interface for forthcoming lightswitch feature

This also includes some shared plumbing and averts impending naming conflicts
Add daemon-side support for the lightswitch flicker and use usec time constants