Beginning of recursive-descent version of IMAP parser.