Add AMD support

This adds AMD support, and still creates the global `Locstor` object if you aren't using RequireJS, etc.