Implemented the conversion routine

The conversion routine was moved to ZoneInfoFile so that it could
be tested and shared with nodejs later. All unit tests pass now.
Also fixed some other methods that had some hidden problems.