Added adding of references, with an error if you add the same url twice
Just realised I forgot to add a bunch of stuff