Final re-factoring of seating.js before reimplementation to angularJS