Add Group "type" field, and GroupsTest class
SQLite: Improve group management, and code for joining and leaving groups