incorporate support for gnulib into build

add support for AUTH=PLAIN

rewrite test client to use a state machine to automate running through
all commands

add support for setting alert and info callbacks

add support for CHECK, CLOSE, SUBSCRIBE, UNSUBSCRIBE, CREATE, RENAME,
DELETE

reorganize imap.h to group functions intelligently