Update mag.js

formalized calling pattern and namespace

name String, options [Array, Function]