Updated selection filter stuff.

There is still a good degree of testing that needs to be performed on
this stuff, namely the Dxf codes need to be validated, but it's
otherwise functional.