fixed #14; fixed exports, plus many other fixes