Replaced jQuery deferred code with more traditional code examples, added initial state functionality