Made mkjl more generic

Made templates rely on functions and inheritance. The templates are smaller and more maintainable, and much easier to add.