A bug in the RefCounted class's design was causing an assertion failure in its destructor, causing the process to abort because in C++11 it's a fatal error for a destructor to throw an exception. Fixed this and refactored two other classes so their destructors weren't doing work that could throw.
@borrrden : The first commit is pretty straightforward. The second one is bigger than I'd normally send out for review, but I think it deserves review. Feel free to ask for a guided tour if you need one :)
A bug in the RefCounted class's design was causing an assertion failure in its destructor, causing the process to abort because in C++11 it's a fatal error for a destructor to throw an exception. Fixed this and refactored two other classes so their destructors weren't doing work that could throw.
Fixes #105.