Made the library lazy and use persistent data structures until the last possible minute.