You can do a System Format in your 3DS options to "start from scratch"; it will erase all software on your 3DS that did not ship with the system, and will unlink any linked NNID. It won't affect system software or firmware version, nor will it affect A9LH. In order to get rid of A9LH, you need Decrypt9, and a NAND backup made before you installed A9LH. Just put the Decrypt9 app in the "payloads" directory just like Hourglass9, rename it (I personally use either "X_Decrypt9.bin" or "Y_Decrypt9.bin", I don't remember offhand), and then restore your backup using the same method you would in Hourglass9. There are two options to restore a NAND backup in D9, obviously you don't choose "Restore (keep A9LH)".