This commit cleans up the package structure, to make two new top-level
packages `internal` (for internal-use packages) and `pkg` (for general
shared utility code).
This commit updates the handling of expanding of templates. This is to
prepare embeding templates directly as opposed to embedding a single
resource directory.