Split the Storage code into a separate file.

Fix #1.