Added Sqlite storage. Fixed some IO stupidity.