Added javadoc

Hopefully that's a good start... 
Lots of p here too.