storage: implement backtrace sorting by quality
tests: add test for backtrace quality and sorting