More code clean-up, interface changes, and fixing some issues with how relative links are handled