added code to remove circular references in order to write json
fixed some errors in looper.js
base64 encoding is working