Added phpDocs, added console_* functions