Use codec package for utf-8 file IO
Simplify build_amd

Both build_amd and build_browser were the same except for one line exlusive
the amd build. Reused the build_browser and added and optional isAMD
boolean.
Make json.dumps use the orginal encoding (utf-8)
Remove regex match for `/`

Withe the extra `/`, the build would throw an 'Unmatched quote' error for
the cdn build because of the website links in the language headers. As far
as I can see, there is no reason to match for regex in `mapnonstrings`
function.
Merge branch 'build-script' of github.com:sourrust/highlight.js into better-build

Conflicts:
	tools/build.py
Explained the reason for `utf8_open` in a comment.
More pythonic parameter name in the build script.