Bug 903740 - Improvements to context ui visibility plus some tests. r=mbrubeck