Started implementing tracker communication

Also some refactoring