messages: refactoring and REST API

Signed-off-by: Konstantinos Kostis <konstantinos.kostis@cern.ch>
messages: refactoring and REST API

Signed-off-by: Konstantinos Kostis <konstantinos.kostis@cern.ch>
messages: refactoring and REST API

the following changes are done under the module messages,
The models.py file is changed and the MsgMESSAGE class contains methods such
as send, reply_to_sender_only and reply_to_all_users
Created an api.py file that interacts with the database and its functions mostly
use the SQLAlchemy ORM mechanism
Also created a util.py file that contains some useful functions
Finally the restful.py file will contain the restful api for the messages and
it will make use of the api.py file
In the restful.py file now exist a cerberus validator for posting json data
when someone wants to create a new message, an error handler and a MessageObject
class that is used to marshal a message as JSON.
Also in the errors.py file there exist some exceptions for messages
Created the test_messages_restful.py under the messages/testsuite in order
to test the restful.py file and all tests passed succesfully.
Fixed datetime dates of the reply methods of the models.py file
Added 'reply to sender' functionality to restful api
Fixed datetime utc iso issues
Removed commented imports and code from api.py and restful.py
Removed run_sql from api.py and rewrote it in SQLAlchemy's syntax

Signed-off-by: Konstantinos Kostis <konstantinos.kostis@cern.ch>
messages: refactoring and REST API

Signed-off-by: Konstantinos Kostis <konstantinos.kostis@cern.ch>