Add StateFns and more work on Shaders

Signed-off-by: Rick Taylor <rick@tropicalstormsoftware.com>