Some refactoring and increased test coverage
added toolbar tests
refactoring and created a triangle tool.