How to build a realtime jQuery plugin