Implement scanner

First time merging with Kyle's scanner.c. It needs further testing with the test files, and finish keyboard parsing.