Add EGL api wrapper (need to be moved to separate branch) and improve separation of APIs.