more systematic (and sane) approach to handling relative paths