Clean up Platform-related functionality.

This is the first step in cleanup. The primary goal here was to remove
unused code. Next I'll try to get rid of hacky functionality now that I
have a somewhat better understanding of the problems I was having
before.