Indexing improvements and Javascript refactor

Minor improvements to indexer: Ignore disabled stores, reset search results less often, more efficient query options, more efficient results insert statement.
Javascript refactor: Move more Javascript to external skin file and make more OO-style.