Rewrite func_log()

This PR completely rewrites the func_log() function to be able to
parse `ws_value_*` types into their string representation and log them.

Pair-programmed-with: ~~Marcel Müller <com2040@gmail.com>~~ @TheNeikos 
Suggested-by: ~~Marcel Müller <com2040@gmail.com>~~ @TheNeikos 
There is no need for `fary`. Storing the index of the element you were processign when bailing out is sufficient for deinitialization in an error case.