JavaScript Game Programming Patterns