implement, test and use magnet complete callback
remove scrape argument from main, add a scraping test
document a util function
minor refactoring