Adds cards to piles and moves some code around from places where it was slightly inappropriate.