Moved lib folder to examples root to save copying all the time

Using forEachKey over forEach for lookups that don't need the component
value.