[quest] Refactor: add quest type, simplify finalquest code. Add tests.