Modify ldflags so that it compiles for me
Prevent big memory leak of nodes

Problem now owns nodes created by Problem.Add().
If malloc fails, garbage collect and try again, then panic.
Add relative weights for each class.