refactoring of buildbot.status.mail.defaultMessage() function

Broke out parts of buildbot.status.mail.defaultMessage() function into new private functions, to make the code more readable and testable. Unfortunately the diff is bit hard to understand, so take a look at the end result :P

Added unit test for default message generation code.

These changes will create a merge conflict with nine branch, That is due to the new 'CANCELLED' build result. Here is diff for resolving the conflict: https://gist.github.com/elmirjagudin/8282611. Not sure if there is any better way to sumbit merge conflict resolutions.