Added test for getRealtimeDataObservation, cleaned up some code.