This commit updates the handling of expanding of templates. This is to prepare embeding templates directly as opposed to embedding a single resource directory.