Number of new keys support, better numeric values encoding/decoding. Refactoring, minor fixes and improvements