Bug 997067 - Build BuildURIFromBase into SecurityCheckURL and condense logic. r=bz

This has a tiny behavior change in the case of self-navigation by a non-current
inner, but I think that the new behavior is more correct.
Bug 997067 - Remove the special behavior for chrome navigating non-chrome windows. r=bz

Considering what is actually done with sourceWindow here, I don't think this
check is doing anything useful in the modern world.