huge change in function organisation for the sake of reusability
documentation super-draft
yet another *huge* change. Added json->message parsing and updated some classes. Small change in api specyfication