Reorganize code into packages. TODO: fix GetUserByUid which is not finished