small, simple, correct URI parsing and generation