tools.h - Change header to C style.

And change a small amount of code to look cleaner.