Introduce tools module
Add some unit tests