Added code for the trimSubparts method:
This code needs to be tested with existing log files. Also, some source has been refactored and reformatted. -Alex