addRecord for the namespace
fix json, remove unneeded deps
split up functionality into three files to ease scoping, singleton functionality and code readability