Fix the way weak pointers are stored in objects.

  - Joint::robot setter now takes a weak pointer as input.
  - robot_ is placed and thus initialized before body_ in Joint class.