realpath: Fix swapped names, dirname and basename
realpath: Use takeBaseName and takeDirectory
realpath: Use joinPath instead of "%s/%s"
realpath: Remove nulldot

Remove nulldot, since takeDirectory already does this.
realpath: Fix bad printf output