JS functions will now throw errors if you call them incorrectly.
Added some new Tests.