Make Formatter usable as an AMD module

Defines Formatter as an AMD module if an AMD compatible define function is found in scope. Does the same for CommonJS and falls back to defining it as `window['Formatter']`. Tests all still pass.