Lotsa revision, not done yet.
- Updated many comments.
- Noticed several errors, added more TODOs (identifiable by the
"issue #65" label).
- Deleted some functions no longer being used.
Also some pointless whims:
- Changed the name of the BIB lock because it was too wordy.