Use 1.6 source compatibility for now
Refactor IMAP code + tests
Move tests to JVM + convert to modern syntax