validate arbitrarily nested objects with functions