Preparations for ajax-support

Sample implementation for ajax-based counting of items and posts. This
way we can do a page-based resync/remove/reset, controlled by the
browser.