GH-2 Style changes and saved artifacts

Style changes include: variable declaration at top of scope;
indentation; usage of core API functions; used self instead of this
consistently