Creation of WeaponScriptManager and minor code optimizations