updated demo page to use Bower for dependencies
got type inference working from inner closure