Added functionality code for Territory & Facility history graphs. #24
Fixed a SQL error regarding ResultID.