First commit

MySQL untested.
Cach file functions should be smarter.