Format code according to PEP8.
Prefer the longest match when searching for spec.
Add toggle between class and spec functionality.