This branch is cleaning up the AMG memory management in order to get rid of manual pointer juggling and thus improve maintainability.