Bug 816257 - Detraitify panel implementation.

This change lays foundation for followup change that will later on will make panels compliant with private browsing windows.

This is WIP as I have only run manual tests so far.