Add unit tests for directionService. Minor refactoring.
Refactoring and better tests. New commandService.