Added unittests, cleaned up constraints, implemented template mixin test