Refactor theme modules and add support for Cardinal