check first for commonjs rather than AMD

It will make a difference for me if this check first 
for common.js module system rather than AMD module system.

This is exactly as you do in other projects like qwery, bean, 
reqwest and bonzo.

Thanks,