an implementation from http://en.wikiversity.org/wiki/Web_Development_with_Webmachine_for_Erlang