Sync from libucl, update to use the new API
Remove dead code