Escape URLs, support B flag, better END flag support, added flag TODOs