sl2: Encapsulate code analysis into a single object.

This is in preparation for analyzing const/non-const inside a screen.