Refactoring

Also fixed jaskell.each being called on non-html collection objects
(that contain lengths that cause unexpected behavior)