Reverted old rep3.py behavior for old distros

Will output a warning
Revert old behavior for compatibility with old distros
Fix bug in rosdistro helper

When hot-switching index url, need to flush the cache
Added unit test, fixed another one

Also fixed a potential pitfall with editors that strip trailing whitespaces