Initial import of code from @riko642
Correct enum declaration
Move class declaration outside of function
Cleanup imports
Parse inputs and outputs via command line
Move headers into include directory
Correct template bracket syntax

Before C++11 you can't place the closing two right brackets (>) next to
each other, as this collides with the stream operator
Switch from using itoa to using TypeConv.h
Add include guards to headers
Link with libterra
Add some missing header includes
Minor corrections
Remove remaining use of scoped enums

Should not have been allowed by visual studio without enabling C++11
support