Revert "Squash Revert newtheme engine (not ready)"

This reverts commit da1ac36cd1823397b673ca3bcbdd576387f140d6.