Added and enhanced inline documentation

Fixed missing documentations and coding standard errors after phpcs run.
Applied the BSD 3 clause license to all files.