Updating local copy to reflect some refactoring changes. Consult with Renan
and Oliver prior to full integration: I'm not fully happy with these alts.