utils: add more checks to readInt/readString
test: move utils tests