Initial commit, with per-company query support