Refactored code. Fixed lexer to catch invalid hex/binary numbers.

Also added more verbose error catching capabilities.