Let's take a look at the design of these features.
Messages are the core of any messaging system. Generally, a message would contain details on the sender of the message, receiver of the message, and other metadata about the message, subject, and body. In our case, the message will be more simplistic. Our messages will contain the sender, subject, body, and the data sent. It will also contain details of the type of message (message, friend request, and so on).

We will need to create a page that allows a user to compose a new message. This interface should also allow a user to add his/her friends easily rather than force them to remember everyone. Also, this interface should allow a user to quickly snap together some HTML without ever having to look at HTML. This can be accomplished with a WYSIWYG editor.