Added option to add output header to the output + Tests
Removed need for random temp tables + added join tests