Replace mathsearch module with a self-contained role class

* Remove mathsearch module but move its logic to the role class.
* Two assignment statements are not enough to warrant a full-blown template
  file. Replace them with an array of string literals instead.
* Misc. linting.

Change-Id: I53eab704f5355e3ddb4a6ca4c2570f7dbf420248