More robust parameter handling in buildProgram (+ Jasmine test cases); also added couple of built-in math performance benchmarks