Add detection of scheme

ping @weierophinney

Are you respecting the spec now ? :D