Fixed UnicodeDecodeError in json encoding

Encodings other than utf-8 and ascii were not encoded in json, resulting in broken builds.

Fixes #9
Fixes #11
Closes #15
Merge pull request #19 from coagulant/UnicodeDecodeError

Fixed UnicodeDecodeError in json encoding