Test mbsync plugin

Exposes bug from #693
Refactor mbsync