add candidate handling

Integrate proper stdlib candidate handling API into #15. See there for details.