Erlang grab bag of useful functions