Added writer for methods

Implemented enough code to write the user-defined methods to file.