Search for custom highlights using a single call, rather than a loop
Refactor getNickStyles function

- Fixes one bug where the asCssString function was included in the
  iterator and so added to the styles
- Reuses functions wherever possible, since this method can be called
  quite often