Added instance methods to model and modified model validation

I ended up making two changes in this pull request. 

1) Added a setting in the configuration model that accepts methods instance, I needed to customize the toJSON for all my models, using the onLoad method I could not do in the instance where it was used the new.

2) modified the validation method to pass as argument the connection, enabling more complex validations do. Another change was that if the return message is not a string, its value as the callback object will be returned.