main: improved mouse events, added the ability to deselect objects

LMB - select, RMB - deselect

Would like to move the whole event switch to a seperate function, but that would mean flinging the main object pointer around. Probably going to do that next commit unless I fix the structure algorithm first.