improve documentation

Fix a typo, add docs to alarm, add anonymous namespace documentation.

As well as documentation, actual code needs more comments added.