Basic message handling.

Still need proper error handling.