Extract mime-type detection to static method on file
Allow to render layout resources as smarty templates