Finally re-implemented all constructor functionality and a bit more with angularjs.