use normal node structure for libraries accessible by index.js
added external API for /survey/* and /instance/* endpoints, closes #4, closes #30, #29