waitport, some setuser refactoring

Signed-off-by: Barry Allard <barry.allard@gmail.com>