Add model/perm and model/group objects with tests.  Fixed str_indexof