Removing dead code and general cleansing: refs  #516