Fixed custom data element marshaller to bring into line with new extendible/published element. Added functionality to delete the search query when the context changes