Scanner context and pipeline refactoring
Fixed broken tests