Adding phpDoc comments

Every functon is now commented. I will generate phpDoc comments so you
can work easily.