First very bugy version of datafile.

Some file cleaning and first draft implementation of datafile