Fixed importing into commonJS environment

Solves #326