Made a lot more functions static
Fixed MSVC project file, and removed C99-isms for MSVC