Add AMD compatibility.

For requireJS etc.