Sharing code between a CommonJS and AMD environment