Theory behind Experiment: Extraction and Identification of DNA
1) Sodium dodecyl sulfate (SDS) is a solid anionic detergent. It can solubilize proteins and lipids that frame the cell membranes by degrading the cell (the proteins from the cell membrane get damaged and cell gets broken) and nuclear membranes that protect the DNA. This will help the cell membranes to separate and expose the chromosomes that contain the DNA. SDS can also release the DNA from histones (a group of basic proteins found in chromatin) and other DNA binding proteins by denaturing them. Breaking the nuclear membrane exposes the DNA to reactive and possibly dangerous chemicals in the cell. To slow down these chemical reactions, which might damage or break up the DNA, you must use cold ingredients and add cold alcohol. Also, it is also known fact that the colder the alcohol is, the more DNA it will extract.

2) Once the DNA has been released, adding papain extract helps untangle and unfold the DNA from the other parts of the cell. The enzymes in papain break down protein attached to (or tangled with) DNA molecules, making them free from proteins.

3) DNA is not soluble in absolute alcohol but soluble in water. If you pour alcohol rapidly it will mix with water and you may not have DNA precipitation. Therefore, you should slowly pour ethanol (or isopropanol) down the inside of the test tube with a Pasteur pipette, so alcohol layer build up on the extract.

4) DNA is soluble in water, but not in salty water. All the other cell contents are also soluble in water and salt water. This difference in solubility allows you to separate DNA from the rest of the cell material. When the DNA leaves the salty water mixture, it comes into contact with the alcohol but cannot dissolve (DNA is not soluble in alcohol either). When DNA comes in contact with alcohol, it uncoils and precipitates. All the other cell materials stay in the salty water solution. Note that an uncoiled piece of DNA can be $\pu{2.8 inch}$ ($\pu{7.2 cm}$) long, and visible when few of them tangled each other. 

5) Diphenylamine will react with deoxyribose sugar in an appropreate condition to give blue-colored complex. This is te principle underlying estimation of DNA using diphenylamine. This is called Dische Diphenylamine Test For DNA:

 

One of the acid degraded products, $\omega$-hydroxylevulinylaldehyde, under acidic conditions, reacts with diphenylamine to produce a blue-colored complex that absorbs at $\pu{595 nm}$. The intensity of the blue color of this complex is proportional to the concentration of DNA. 

About using UV-vis-Spectroscopy to determine the purity: The fact is that nucleic acids have an absorption maximum at $\pu{260 nm}$ UV wavelength. However, this absorbance suffers from interference from othe molecules such as single nucleotides, proteins, and single-stranded nucleic acids (as well as RNAs). Thus:
DNA concentration (in $\pu{μg}$ DNA/$\pu{mL}$ Solution) $= (A_{260} - A_{320}) \times 50\times$ dilution factor where $50$ is DNA extinction coefficient, $A_{260}$ and $A_{320}$ are absorbance of DNA at $\pu{260 nm}$ and $\pu{320 nm}$, respectively. In general, since the DNA has limited absorbance at $\pu{320 nm}$, this is simplified as:
DNA concentration (in $\pu{μg}$ DNA/$\pu{mL}$ Solution) $= A_{260}  \times 50\times$ dilution factor

Yet, the DNA purity is determined with the help of software. This is done by measuring the absorbance of the DNA against protein:

$$\text{DNA Purity} = \frac{(A_{260} - A_{320})}{(A_{280} - A_{320})}\approx \frac{A_{260}}{A_{280}}$$

If $\frac{A_{260}}{A_{280}}$ is in the range of $1.7-2.0$, the content of the solution is considered to be pure DNA. In other words,, constructing an absorbance ratio between these two absorbance wavelengths can provide an estimate of sample purity. As a general rule any preparations with a $\frac{A_{260}}{A_{280}}$ ratio greater than approximately $1.7$ is called pure.

Sources:

http://www.biotech.iastate.edu/publications/lab_protocols/DNA_Extraction_Onion.html

https://openlab.citytech.cuny.edu/bio-oer/chemistry/biologically-important-macromolecules/nucleic-acids/nucleic-acids-dna-extraction-and-disches-diphenylamine-test-activity/

https://www.news-medical.net/whitepaper/20140203/DNA-Analysis-with-UV-Visible-Microspectroscopy.aspx

https://www.bmglabtech.com/fileadmin/06_Support/Download_Documents/Application_Notes/AN263.pdf