Change usage of std::list to std::vector and clean up some memory leaks -- currently segfaults.
Don't use deleted pointers. Fix the segfault. Thanks to RedFox on IRC for input on both this and the previous commit.