Cleared up mono build warnings.

The code has been cleaned up to prevent warnings that appeared during the mono build.
Unused/unreachable variables/code have been commented out.
Some warnings cannot be removed as they relate to variables that are required for the code to run, but are not used later in the code.
All tests that previously passed still pass.