Improve highlighting more

Some additional matching improvements and a refactor

* Handle filename matching
* Prefer matching touching letters, ab_b_c will match the first ab
* Clean up code