Moved most of the methods for the properties dialog into their own file. Also fixed the calculation of oils on a map.