Added parameter validation to module function.
Refactored.
Refactored.
Merge remote-tracking branch 'origin/master'

Conflicts:
	jsfac.js
Fixed a bug in shared instance resolution method.