Re-implement lint with less emphasis on item ids

This way it's much easier to add lints throughout compilation correctly, and
functions on impls can alter the way lints are emitted.