Oops, completely re-implemented the whole parameter management thingie.