Added maxItems support to cache updates

maxItems's aim is to prevent X usernames (default to 5) to appear in the DOM when mentioning. It does work when initializing the popup but not when updating the popup. This pull request patches this behavior.