Priority Queues

Added Priority Queues. Added custom exceptions. Started adding code
contracts (although further work in this area will probably be
de-prioritized). Fixed many missing bounds checks.