Add KIM_API_get_rank and KIM_API_get_rank_by_index functions.

These are useful because KIM_API_get_shape() expects an allocated array
argument with a length of the rank of the parameter. So the only way to
use that was to use an array that was much to big. Now the rank can be
queried and the array allocated as needed.
Fix test makefile.

Building a test with more than one file failed. By putting "$(LOCALOBJ)"
before "$(strip $(TEST_NAME)).o" the variable $< would be set to the
first entry of LOCALOBJ which would then be linked twice, while the
actual "main" object file for the test would not be linked at all.

This is now fixed by rearranging the dependencies.
fixed some bad lines in the fortran templates