Experiment with some new build+link flags
Fix discovery build
Update code to new APIs