Renaming ndim and outdim in modelling

This is the implementation of renaming `ndim` to `n_inputs` and `outdim` to `n_outputs` (deprecates #1045).