Separated implementation of grain_system::state() into cpp file.
Made x, x0 private