more database

more changes moving towards databases. Haven't tested the user add or
friend add.