Added some robustness checks to handle poorly formatted/unclean OSM files.
Added function to handle getting all data from osm file, so all variables can be locals.

Signed-off-by: Ted Steiner <tsteiner2@gmail.com>