Add rectangle class, refactor collisions and behaviours, fix mouse controls slightly