Implemented MasterScriptFactory and added junit tests for it.