fixed method bugs and added compiler for function

method compiler was using the source code of the method body instead of the compiled code when constructing the method value. Also, changed the method compiler to use a primitive for constructing the method value.