Integrated theory of finite element methods