added support for defaults as a function as per backbone