Fix a PDO bug

This was overlooked in the conversion from MDB2 to PDO
Use a more reliable method of deciding whether to show history years

The old approach was convoluted, and didn't allow for non-repealed laws
with useless amendment years (e.g., laws that are "not in effect," but
not actually repealed, or laws that are placeholders for future laws.)
This is simpler and more reliable.
Format the code more nicely

Let connecting periods breathe.
This is v7 now, not v6