Re: Legal basis?
In very very short terms, "diplomatic passport" <> "diplomatic immunity". Ecuador can give him a certificate declaring him a God for all it matters, as soon as he walks out of the embassy he's on UK soil and they can do what they like to him. So he's effectively in prison.
Plan B is the UK let him go to the airport, effectively barring him from ever entering Europe again as he's now a wanted criminal (bail dodging, suspicion of sexual assault etc), Jemima Khan loses her bail bond.
Unfortunately, what will likely happen is the Plan C will happen - the UK will challenge Assange's right to political asylym (as I understand it, the right only applies if your own or host country is persecuting you - the US is neither) in international court, thus dragging it out another 12+ months meaning we never hear the end of it.
I'm all for Wikileaks, but this is very little to do with them, and all about a man scared to face up to his accusers.