glx: split out current context code

also clean header inclusion after code movement
7 files changed