Separate business and server logic

Also added deselection clicks and fixed bug where there'd be a crash if the items for diff were identical. Added script so you can do npm start.