Split searching for message uids from loading the messages.

This will allow more flexible message loading strategies, such as loading messages in batches or only loading specific messages.
Select the INBOX when initialising the Gmail client

As we never operate on any other mailboxes, there's no need to select a mailbox before each operation.  This makes the client specific to the single mailbox, which given the mailbox-centric way that IMAP works seems to be a useful property.
Sometimes it's nice to fetch a single message given a UID
Store messages in the repository against a given key, using the message UID

This will allow us to check whether the repository already contains the given key, allowing us in the future to only import messages that aren't yet in the repository.
Don't reimport messages already in the repository
Move MD5 key generation right down to the message store.

If we're storing messages in the repository with a given id, key generation is redundant as far as the repository goes.  It's now the responsibility of the message store itself to decide how to save files.  For now we're still using MD5 hashes but this could easily change.
Import ALL the email from a user's account, not just their inbox messages

I've been testing against my tom.ward account and sauron-test, neither of which have enough messages to really break anything (in their inboxes at least).  Switching to All Mail to try and destroy things.
Use Mail to bypass encoding issues

Attempting to import all the emails from tom.ward@gofreerange.com I encountered some nasty encoding problems like this one:

  Encoding::UndefinedConversionError: "\xA3" from ASCII-8BIT to UTF-8
    from /Users/tomw/Projects/freerange/sauron/lib/file_based_message_store.rb:14:in `write'
    from /Users/tomw/Projects/freerange/sauron/lib/file_based_message_store.rb:14:in `[]='

Rather than worry too much about this, I decided to pipe all imported messages through Mail.new to see if that fixed the problem.  It seemed to, but we should be aware of encoding problems that may arise and fix the underlying problem when or if it becomes the next most important thing to do.
Use Base64 encoding when storing messages to avoid encoding issues.

Passing messages through Mail.new(message).to_s worked for about 1,100 of my messages, but not all of them.  Base64 is safer.
GmailImapClient => GoogleMail::Mailbox

What was previously the client only provides access to a single mailbox, so can be called Mailbox with little confusion.  This makes many things clearer to me, such as referring to 'all the messages in the mailbox' (rather than the client).
The GoogleMail::Mailbox#messages method might be useful one day, but is not currently used
Give the FileBasedMessageStore a default root path
Change MessageRepository to use a FileBasedMessageStore by default
Let's add messages to the repository, not store them.
Only the MessageRepository itself should need to call #instance
Cucumber should use AccountMessageImporter to import an account's messages
MessageRespository#includes? clashes with Class#includes?.  Use #exists? instead.
Return our own Message object from the repository, not a Mail object
Introduced a CachedConnection, storing all cached values in an IMAP cache
Use an ActiveRecord model to record each imported message.

To display a list of messages, there's no need to store them as files on disk.  Only their subject, date and from is required, so store these as records in the database.

One advantage of storing the messages on disk is that it avoids having to reimport data (which can be very slow).  However, using the CachedConnection to IMAP should negate this.