Fixed typeahead to search against symbol and name; did some database.js cleaning

Also cleaned up syntax here and there