Tidy up app.model() to remove duplicate & recusrive call

/to @bajtos 
/cc @ritch 
I am wondering if it's worth simplifying this code by removing `isPublic` variable and using `Model.shared` instead?

The two-argument branch can update `Model.shared` to `config.public !== false`, the one-argument branch can update `Model.shared` to `true`.