Since factorial() is potentially called many times, we might want to use an [iterative implementation instead](http://jsperf.com/iterative-factorial)