Small JavaScript DOM level 1 implementation