Bug fix - Topic search broken due to encodeURIComponent being called too early

It looks like topic search was broken due to ```encodeURIComponent``` being called too early.  The ```term``` was being replaced with the URI-encoded version before the regexp check. So ```in:topic-29``` becomes ```in%3Atopic-29```, which causes the regexp for matching a topic search to fail.