Extract code to iterate over bookmarks
Use self designed iterator objects

iterators and generators are not yet available in google chrome
fix several typo's and forgotten 'this.' identifiers