Server side mentions count

Implement maintaining mentions count for a user nick in a channel on server side, along with other bugfixes.