WIP. Making progress on completely generic token allocation