PATH_MAX defines moved into a separate file.
shell() simplified somewhat.