Various updates

This was meant to add caching for various rules, which is the first two commits.  But then I also threw in a bugfix for when no matches are found and the user hits enter in the UI and docstrings for the undocumented.