Refactoring and fixing

Added class GraphSettings, fixed bug with gravity, fixed bug with
sockets