Respect automatic-install mode from pkgdb in transaction updates.

Also simplify register/unregister and remove useless state definitions.