Backport of functools.lru_cache from Python 3.3 as published at ActiveState (https://code.activestate.com/recipes/578078/)
