Corrected a bug in calculation of arity in generated Erlang code.
New structure for examples and a new example.