memleaks--
sort decls and use binary search for lookup
log errors in tests