I've finally ironed out everything I need to start implementing matches using the prefix-tree I've written for #modal.