Test return values directly

Don't store $? in $retval unless it's absolutely necessary.
Use $EUID instead of `id -u`

This saves a call to the id executable.
Use =~ in tests

Use [[ ... =~ ... ]] to save a few calls to egrep.
Replace a grep call with a pattern match
Use `command -v` instead of `which`

This removes our dependence on a well-behaved which, lets shell
functions work in place of executables, and saves some calls to
an external command.
Don't use cut

Feeding wc via stdin suppresses the filename so there's no need to
strip it with cut.
Clean up bash conditionals

Use == or != with pattern matching to improve readability.
Show symlinked actions in `clicraft help`
Fix player detection in pregen.sh

The list() function prints a space-delimited list of players, not
and newline-delimited one.