Implemented duplicate button for queries

Implementation of issue #258