Added socket basic functions and ORM for models