cleaned up javascript
accept models that use attribute names as setter functions
accept functions without callback as attribute values