Create tools.h

This file contains declarations of some generic functions. The functions have public scope and may be called at any point.