Initial implementation of stateful signals. Renamed a few things.