Fix incorrect dirty flag when initializing from JSON #151 (fix jquery) , closes #151