Added index to db for username column

Also, added callback to force username to lowercase when persisted to database

Signed-off-by: Ippoippo <ippoippo-software@ippoippo-eco.com>
Added secure password code

Unit tests are working, two issues with Controller tests.
Same approach has worked elsewhere, so need to work out why user is not being persisted.

Signed-off-by: Ippoippo <ippoippo-software@ippoippo-eco.com>