Rewrote duration parsing code to use parsec, and small organizational changes