System.registerDynamic implementation, fixes #161