Feature/js namespace

See #486 and #491 - this resolves both.