remove prototype and add AMD/CommonJS module structure