fix ../ paths for new file system
add support for site-root relative paths
hoist vars
add unit tests