Improvements to when completions are done

Completions are recalculated after switching schemas and if a space
preceeds a . it wont try to complete for table_name = ''