move message rendering from server to client javascript

fixes #113, fixes #12