Egl context state

Improves EGL support by implementing a few missing functions. Adds unit test for EGL context creation.