Valves and tvalves

Also new prototype to reduce code
Pretty much rewrote all the caching code again

Also, omni devices
Final cleanup
One more time