Major re-write of the theming engine
Added missing license headers