Events. User interface. Refactor

Added event dispatcher. Connected used interface and player through
event dispatcher. Done some refactoring.