Overhaul Javascript documentation.

Added straight forward examples and suggestions for registering, enqueueing and localizing.