The IMAP handling code is already implemented as a storage driver. So, yes it already is possible to use a different driver, but you'll need to write it. You have to write a class similar to rcube_imap (the only driver I know) class, let's say rcube_my_storage and then set undocumented 'storage_driver' option to "my_storage".