Bugfixes, Unit tests

- Migrated project files to VS2012
- Added test project w/ various unit tests
- Fix for #20
- Numerous smaller bugfixes