Code rewrite and minor fixes.
Add bower component.json