recursively Object.freeze() on objects and functions