move kind computation to function
Created by: nicksnyder
followup for https://github.com/sourcegraph/sourcegraph/pull/1342#discussion_r241211882
Created by: nicksnyder
followup for https://github.com/sourcegraph/sourcegraph/pull/1342#discussion_r241211882