Add methods_to_x relationships

- Add methods_to_functions because it should be unique from functions_to_methods.
- Chang references to self and $this to the correct classname
- Put the things a method uses into the database as a p2p relationship