CMake and Win32 support

These changes should build with CMake and also on Windows. Should also work on Unix.

Also please review the change to hat-trie.c on line 239.