Finished up removing thread handles when acquiring
and unlocking locks.  Still uncompiled and tested.
Added max function to stdlib to support code readability