Added createMessageElement function

Added previous message-populating code into new function
(createMessageElement) so we can reuse it for step 6!