Learning the raw mathematics behind VAR modelling to implement it myself I have recently been using R, along with the very handy vars package, to model time series and generate forecasting based on the results it produces. I have found a fairly accurate way to model my data with it after spending some time configuring it.
Using R is handy, but as a software developer, I now desire to implement it into one of my projects that uses a different language. This requires me to learn how the modeling works at the most basic mathematical level.
I have prior experience with regression and statistics, but am newer to time series modelling. Because of this, I have searched the internet for resources that will help me learn to essentially do this modelling by hand so that I know how to implement it elsewhere. Unfortunately, most resources just specify to use the existing R package, or another software such as Minitab. Additionally, the documentation for the vars package is quite complex and reads as gibberish to me, and I am not fluent enough in R to be able to port the raw source code of the package itself.
tl;dr I am looking for resources (books, courses, etc) that will teach me the fundamentals of vector autoregression modelling without the use of preexisting software implementations. Starting from the very beginning (learning AR, ARIMA, etc) is perfectly acceptable. I just want to know how it works and why.
 A: Partially answered in comments:

Have you considered Introduction to Multiple Time Series Analysis by
  Helmut Lütkepohl and Time Series Analysis by James D. Hamilton?

– Dimitriy V. Masterov

Maybe also Applied Econometric Time Series by Walter Enders.

– Dimitriy V. Masterov

This could prove tricky. For example, James Gentle in his book
  Computational Statistics says that statisticians should be aware that "the form of mathematical expression and the way the expression
  should be evaluated in practice may be quite different". For that
  reason, time-series books may be only useful to a certain degree. You
  will also need some decent linear algebra / computational statistics
  references to complete this admirable objective. I'd say, it's a lot
  of work and you'll need to understand a lot - more than time-series.

– Graeme Walsh

The way the vars package estimates VAR models is
  equation-by-equation. For that, knowing simple regression is enough
  (which may be surprising). You do not need to learn ARIMA because (1)
  it is not a subset of VAR and (2) it involves different logic and
  different estimation techniques which are much more difficult to
  implement it in practice.

– Richard Hardy
