Fix for issue #49

JavaScript Date object uses timezones in a weird way.  Do date math to
work around it.
Fix switch() statemetn to look for string values.
Fix for typos in comments.