ID-45, ID-46: Fixing password algorithm and validation for migration

Somehow, the old accounts have many special cases... like empty password. And invalid username, emails.
See [ID-45](https://issues.openmrs.org/browse/ID-45) and [ID-46](https://issues.openmrs.org/browse/ID-46).

This branch is used to fix those.

And also improved the performance when updating groups documents. We simply do a query for a group via Mongoose before, but these will lead a horribly slow query. So I skipped the those mongoose stuff by using `lean`, and only query the `groupName` to avoid large array copy. Also removed the auto generated ObjectId for subdoument `UserRef`.