Add typedefs. Make compatible with compilation on Windows with mingw by using stringstream instead of to_string. Remove pthreads since we're not using them and mingw complains.