Cleaned up code, added cors handling for table results, added table search and refresh