use realpath as it is more portable

Signed-off-by: Christopher Hall <hsw@ms2.hinet.net>
some parameter changes, normalise mode-alist settings

Signed-off-by: Christopher Hall <hsw@ms2.hinet.net>