Lots of documentation updates

Converted many functions to advanced functions, standardized functions
with a try/catch block and a error log message type and added lots of
documentation