Major rendering refactoring
template and js files renamed
layout fix