Implement the parser's expect() function

Also start implementing parser tests.
Will defer it until we do real error handling.