Add dynamic query creation for single line scripts. Closes #36