added gdb debugging and move valgrind to test/valgrind
fixed several memory errors. Wondering about InputManager.c::promptUserSelection. See comments.