move more functions to the util header
add first cut at solver. still need to propagate exceptions