Added some tests and refactored process function in REST_notify.py.