cleans up stillsprite code. adds some modularity and uses mainloop.