Make Cradle class with unit tests

I wanted to test the cradle changes I am
making but the unittest framework only
seems to work on classes.

Also I think long-term it would be best not
to use stdin and stdout so the class allows
for other file-like objects to be used.
Fix bug in getNum()

Not really an error causing bug, but calling
upper() on a string we expect to be digits
does not make sense.