Added check to make sure UDP header length is valid. Moved a few bits around to tidy up the project.