improving module factory
fixing small errors
fixing small issues
trying to find why callback for factory initialization is not triggered
fixing js syntax error
improving factory