Rewrite buffyboxes and add support for maildir flags

It always annoyed me that buffyboxes did not account for unread mail,
it only checked for new mail.

Sadly, I had to do this in Perl. Python and Bash were too slow. With
Perl, though, it's barely slower than a simple "find".
newmail: Output of buffyboxes is already sorted now