Fixed various threading issues by changing shared variables to volatile. Also fixed and completed Javadoc for all current classes bringing the Javadoc up to date.