rewrite import paths

This patch is meant to fix #68.

Some issues already reported in #81.

Comments and further testing are welcome here.