Code cleanup

Ordering and documenting the code
added default cookie
updated example config for required values