MB-7478: Initial changes to Kang's implementation

These changes allow it to receive multiple requests without
terminating and allows demarcating requests more explicitly.
Add error handling to reduce (but not prevent) core dumps.
Things like FP exception will still cause a core and restart
by Erlang supervisor is expected. Clean up logging a bit.