Erlang: Dispatching closures (OOP style object implementation in FP)