Add copy constructors to query and record classes.
Also add "clone" function to record classes.