Added IO abstractions and implementations. Added unit tests.