added realtime support for viewer.js to resolve #7