Split the lifecycle of inspector into multiple functions.

This is done to move the inspector in a new widget within the same window like
it is done other browsers too.