parser: clean-ups

Add a len_kv function to JSONFrame, whilst I'm at it.