Define fcache as constant, add multiple dispatch tests
Create local functions

This is a hack to work around differences in scoping rules between
global scope and other inner scopes. Please improve.