Reorganized some constants

Also started using constants in client side Realtime class through JSON requests