Significant upgrade to tools functionality. Now essentially works, it
is usable to get work done faster. Added some very preliminary unit tests.