Bitlocks and Monitors

This is a single rolled up change for bit locks and monitors. The bit lock code was altered quite a bit due to issues found by test code and other general cleanups induced by its use in monitors.

I think we can start doing higher order data structures after this.