add missing doc comments & additional debug statements
Fixes some broken doc comments, adds a bunch of others that were missing.
Adds more debug statements to improve debugging, since it is difficult to track what is happening in a system app like this that locks the system.
Moved from !207 (merged).