payment_id support, partially code taken from bytecoin