MDL-40368 tool_capability: clean up as per notes from peer-review.

* Coding style clean up.
* SQL indentation
* Removal of non-matching capabilities when searching.
* Fixed notices/warnings when hitting enter on search.