Understanding Diffie-Hellman Key Exchange Help me understand the Diffie-Hellman Key Exchange

From what I understand:


Agreed upon numbers: Both parties agree on the value of a large prime number $p$ and a generator $g$.
The users each choose private keys; Alice chooses $a$ and Bob chooses $b$, such that $0&lt;a,b&lt;n$.
The users each calculate public keys: Alice computes $A=g^a\pmod{p}$, while Bob computes $B=g^b\pmod{p}$. Each sends the other their public key.
The users calculate the secret key $k$ as the other person's public key raised to the power of their own private key mod $p$. Alice calculates it as $B^a\pmod{p}$, Bob as $A^b\pmod{p}$.


Example: $p=7, g=4$. Alice chooses $a=2$, Bob chooses $b=3$, Charlie chooses $c=4$. Then the public keys are $A=4^2=16$, and $B=4^3=64$, and $C=4^4=256$.

In that case, Alice and Bob will compute $$k_{ab}=64^2=16^3=4096\equiv1\pmod{7}$$

Alice and Charlie will compute 
$$k_{ac}=256^2=16^4=65536\equiv2\pmod{7}$$

Questions:


Why does $p$ need to be a prime number?
How does the size of $p$ affect its security?
What's a generator ($g$)?
Why must the private key be less than $p$?
What is mod?
what maths/types of logic formulate the science behind this kind of cryptology?


Also, please correct me if I've made any errors above. Please feel free to offer any additional information that you think will aid in understanding this concept.
$p$ must be a prime number to construct a cyclic group with $p-1$ valid private exponents. Using a composite number might impose security issues and possibly performance penalties.
The size of $p$ dictates the security as it forms the size of the field. The larger the field, the more private exponents to try. The more effort you have to find the used one.
A generator is a group element that has order $\phi(p)=p-1$, so the following equation must hold for a generator $g^t\equiv 1 $ $(mod$ $p)$ where $t$ is the least interger such that this equation holds. This least integer must be $p-1$. Also look at this question to understand why a generator is required.
It would be pointless to choose a private exponent larger than $p$ as one would be again at the bare generator for $g^p\equiv g$ and hence one can save these cycles.
$"mod"$ is the binary operation that outputs the remainder of integer division. For example$7$ $mod$ $3 = 1$ as $7=2*3+1$, mathematicans also write $7\equiv 1 (mod$ $3)$.
This is called "asymmetric cryptography" and number theory is usually the tool used by cryptographers to construct such schemes.


For further understanding, reading one of the established books does help. (like the Handbook of Applied Cryptography as proposed in the comments)