Merging Brody's lib repo into master. This is a bit large, and there is some weirdness with line endings on at least one js fie.