I hereby acknowledge that figure_out_scope has become a mess.
Fix #257
also add test for "drop_unused" (the last one fails for now)