Initial commit. in the midst of refactoring to fit into original app.