Fix crash when material source uses Windows line endings.

* Also would crash if uniform declaration in source used extra spaces or tabs.

`indexOf` bad, regex good.