minor fixes
fixed dates with single digit dates being ignored
fixed bug where daylight saving time (!!!) made dayToDate function skip a day in March every year -.-
Write files in "binary" mode.

On unix there is no difference between binary and normal mode. On
windows normal mode converts all line endings to windows style line
endings while binary mode preserves the line endings as they were
written (in this case '\n')

The javascript for highlighting kanji relies on line endings to be '\n'.