Made cPiston code more readable and configurable.

Fixed some minor problems with pistons, such as pulling water etc. Thanks to TigerW for some inspiration.