Optimize the switch

using an array to store the cases by their WebGl GLEnum value
http://jsperf.com/if-switch-lookup-table
Merge pull request #5 from francoisfrisch/commit-switch

Optimize the switch