The Glasgow-based polymath’s solo show at Chapter, Cardiff, is rigorously informed by ancient and mediaeval religions and spiritual movements