constellation prototype 6

finalized all button-sorting functionality. some misc optimization,
code clearning, bug fixing, etc.