New functions ReadVmFile and ReadLabFile to read data files
Return JSON or HTML depending on Accept header,
use new ReadVmFile function and general refactoring to make nicer.
Finish refactoring $CONFIG -> Config()