Significantly refactored the code to make it more modular and maintainable.

It would be nice if, in the future, we could figure out a way to get
all of the latitude and longitude points into a database of some sort
so that the code isn't so long and ugly.