cleanup stuffs and rearrange apis in dom/query
less code in core.js