Initial user login now trigger logging and indexing

Previously, `Person` objects were automatically created on login, but notfulltext-indexed or logged via `log_eventi`.  Now both are done.`session.flush` is used to confer an ID to the new user, such that it can issueits own `Event` and `Revision` entries.Also, some `import` lines were moved into functions to avoid import-orderissues.  Probably this could be done better.