accounts method was deprecated in v0.17 and was removed since v0.18. accounts was replaced by label and it provides more flexibility as compared to before such as setting label on any address, not just receiving address. It also irons out issues raised in the past. If you are used to using accounts to mimic separate wallets, you now have an option to use ...
I don't know the listaccounts, getaccount and setaccount commands inside the Bitcoin core 18.1.
I think you have used the wrong commands with the bitcoin 18.1, perhaps the equivalents are:
listaccounts -> getwalletinfo
setaccount -> importaddress
But before you use this command look the official documentation rpc framework
The issue is public key compression, as noted in your edit. The original code does not handle compressed public keys.
#here we retrieve the public key data generated from the supplied private key ...
That error is popped up to ensure that the transaction relayed by your node is standard. Since your transaction output that you are spending is not standard you see the non-mandatory-script-verify-flag error. Currently P2PKH, P2SH, P2WPKH, P2WSH, P2PK, bare multisig and null data are standard outputs. This avoids downstream users splitting the network ...
What is the BTC address I could use for creating a transaction?
Any valid testnet address. You can get one from Bitcoin Core using the getnewaddress command.
How do I "unlock" it to be able to send a transaction?
Use the walletpassphrase <passphrase> <timeout> command where <passphrase> is your passphrase and <timeout> ...