WebGLRenderer: Modify to take in existing WebGL context

This patch modifies WebGLRenderer to take in an existing WebGL context, and adds an unit test to test the behaviour. This is discussed in detail in #4353

Signed-off-by: Prabindh Sundareson <prabindh@yahoo.com>