Refactor and comment varlen functions
Merge pull request #64 from cesanta/refactor_varlen

Refactor and comment varlen functions