massive update: new structure, no temporary files, can now embed templates and styles