Umd wrap

allows use in AMD  env as well. also removed few dummy `;` that were not needed after function declarations.