Use collections instead of arrays to enable stronger typing and reduce cruft
use isEmpty instead of size() == 0 for clarify
removed unneeded variables and clarified names
simplify following code review
EnumSet is more efficient than HashSet
Revert accidental change
Set interface makes more sense for flags
Merge pull request #10 from k9mail/art/more-tidying-arrays

Replace many arrays with collections