Mirrored the metals implementation for Godfest. Some minor refactoring and pruning.