Added tail-recursive factorial.