IPSet/IPNetwork performance improvements

IPSet get various improvements related to compaction. IPSet.add() performance for compaction is now O(1) or O(n) instead of O(n*log(n)). For IPSet.remove(), compaction can be skipped completely. 

IPNetwork gets its own __contains__ instead of the less efficient inherited version. Just like the new IPNetwork.sort_key(), it uses the fact that the length of an IPNetwork is always 2**(width - prefixlen).

This pull request includes two old commit that I think you merged by hand. Maybe this time it will work automatically and git notices.