Updated example to fix changes to cowboy handler interface, and, general tidy up.