Weighted Function Spaces and Traces on Fractals