Changed register and aithenticate from events to functions.
added fn name to return msg for ease of debugging
Added notes re DB schema and network traffic.