Expanded Lock contract, added rough MongoDB impl