cleaned up style, moved dependencies to the root lib file, rewritten payment handling to decouple data types from serialisation, introduced helpers to payment class to fetch links by rel type and token fetching