Organized code

Moved search functions to search.js file;
Statistics parsing now doesn’t need sending lot ids to the backend;