Change state and add sort flag

This removes the close flag in favor of a generic state flag that takes a string for the state you want to display.  

It also adds a sort flag so we can sort by created, updated, and popularity based on number of comments.