Back porting Diane's bustard.py from the trunk to v0.1.x branch