Implement various fixes to the logic module

This is my work mostly from
https://code.google.com/p/sympy/issues/detail?id=4076. Aside from a few small
changes, the main work so far is implementing Basic types for True and False.
See the commit messages for more information.

This was a lot of work getting this all together. Sorry for not splitting the
one commit more, but all the changes there were required to make all the tests
pass.

A speedy review would be appreciated, as I suspect that if this sits for too
long that the merge conflicts will become quite large.  I will add more
commits to this as I work, but feel free to merge this at any time if the work
so far passes review.