Implementation of brain

Implementation of brain functionality + REST API, Mnesia based brain storage