Emails and Messages/Notifications

In the standard and customised Elgg implementation there are green messages that appear at the top of the page after some actions are implemented. Where can I access the code to customise the text on some of these messages?

In addition, where can I access the code to customise some of the default emails that are sent out, when someone registers, is added as a friend...etc.