Beginning portability work

* Converted to CMake build structure
* Minor bugfixes for GCC compile
Start of MSVC compatibility work
MSVC build compiles and exports necessary functions
Merge pull request #1 from ncorgan/portability

Portability