Merging gazebo changes onto groovy-devel

Sorry haven't time for someone else to review now. If you can still make a post-mortem review, I'd appreciate it!