Getting the handler into the build.
Some fixes: header guards, typos, bad braces, etc.
Adding some missing caching logic needed for offline mode.