Moving everything into function files
Everything now in *tools.r files