Significant server-side refactor loosely based on MEAN.JS structure