split sources into mem/ and db/ directories. Continued documentation in README.