Get the program to run on Ubuntu.

1. Add CMake files.
2. Make necessary changes to code to account for not using VS2013:
        a. don't use stdafx.
        b. need our own subclass of std::exception if we want to pass in
                a string message.
        c. can't cast unsigned int to unsigned long?
3. Split `delete` command across multiple lines, to appease Clang warning.

I'm not sure if I dealt with 2c in the best way; I just changed the datatype
of the variable that would otherwise need to be casted.