several fixes. Adding initial example based on browserify