refactored jQuery namespace and fixed bug in initialization order