Several updates to some appjs internals."
Setting up base application framework.