Changed how messages are handled and parsed, including support for \n in them.
Also small fix for out of bounds possible for input.