Add freezeDeep function with tests