Separated mention detection and added unit tests for it.